package com.ruoyi.vehicleDispatch.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.vehicleDispatch.mapper.TimeThresholdRuleMapper;
import com.ruoyi.vehicleDispatch.domain.TimeThresholdRule;
import com.ruoyi.vehicleDispatch.service.ITimeThresholdRuleService;

/**
 * 时间阈值规则Service业务层处理
 * 
 * @author niuyi
 * @date 2025-08-19
 */
@Service
public class TimeThresholdRuleServiceImpl implements ITimeThresholdRuleService 
{
    @Autowired
    private TimeThresholdRuleMapper timeThresholdRuleMapper;

    /**
     * 查询时间阈值规则
     * 
     * @param ruleId 时间阈值规则主键
     * @return 时间阈值规则
     */
    @Override
    public TimeThresholdRule selectTimeThresholdRuleByRuleId(Integer ruleId)
    {
        return timeThresholdRuleMapper.selectTimeThresholdRuleByRuleId(ruleId);
    }

    /**
     * 查询时间阈值规则列表
     * 
     * @param timeThresholdRule 时间阈值规则
     * @return 时间阈值规则
     */
    @Override
    public List<TimeThresholdRule> selectTimeThresholdRuleList(TimeThresholdRule timeThresholdRule)
    {
        return timeThresholdRuleMapper.selectTimeThresholdRuleList(timeThresholdRule);
    }

    /**
     * 新增时间阈值规则
     * 
     * @param timeThresholdRule 时间阈值规则
     * @return 结果
     */
    @Override
    public int insertTimeThresholdRule(TimeThresholdRule timeThresholdRule)
    {
        timeThresholdRule.setCreateTime(DateUtils.getNowDate());
        return timeThresholdRuleMapper.insertTimeThresholdRule(timeThresholdRule);
    }

    /**
     * 修改时间阈值规则
     * 
     * @param timeThresholdRule 时间阈值规则
     * @return 结果
     */
    @Override
    public int updateTimeThresholdRule(TimeThresholdRule timeThresholdRule)
    {
        return timeThresholdRuleMapper.updateTimeThresholdRule(timeThresholdRule);
    }

    /**
     * 批量删除时间阈值规则
     * 
     * @param ruleIds 需要删除的时间阈值规则主键
     * @return 结果
     */
    @Override
    public int deleteTimeThresholdRuleByRuleIds(Integer[] ruleIds)
    {
        return timeThresholdRuleMapper.deleteTimeThresholdRuleByRuleIds(ruleIds);
    }

    /**
     * 删除时间阈值规则信息
     * 
     * @param ruleId 时间阈值规则主键
     * @return 结果
     */
    @Override
    public int deleteTimeThresholdRuleByRuleId(Integer ruleId)
    {
        return timeThresholdRuleMapper.deleteTimeThresholdRuleByRuleId(ruleId);
    }
}
